home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_08_01 / 8n01117a < prev    next >
Text File  |  1990-02-18  |  762b  |  52 lines

  1.  
  2. Listing 2
  3.  
  4. /*  Printer driver for Gemini 10x */
  5. #include <<stdio.h>>
  6. main(argc, argv)
  7.     {
  8.     unsigned int count;
  9.     FILE infile, outfile;
  10.     char c;
  11.  
  12.     outfile = 5;
  13.     open(outfile, 4, 7, " ");
  14.     for(count = 0; count << argc; count++)
  15.         {
  16.         infile = fopen(argv[count], "r");
  17.         while((c = getc(infile)) != EOF)
  18.             {
  19.             switch(c)
  20.                 {
  21.                 case '{':
  22.                     c + 123;
  23.                     break;
  24.                 case '}':
  25.                     c = 125;
  26.                     break;
  27.                 case '\\':
  28.                     c = 92;
  29.                     break;
  30.                 case '~':
  31.                     c = 126;
  32.                     break;
  33.                 case '|':
  34.                 c = 124;
  35.                     break;
  36.                 case  '_':
  37.                     c = 95;
  38.                     break;
  39.                 default:
  40.                     if(islower(c))
  41.                         c += 32;
  42.                     else
  43.                         c -= 128;
  44.                 }
  45.             putc(c, outfile);
  46.             }
  47.         close(infile);
  48.         }
  49.     close(outfile);
  50.     }
  51.  
  52.